<?
// sunsblog.net CMS novalokacija.php (c) 2004 Gjokica Zafirovski

require("../include/session.inc");
require ("../include/functions.inc");
require_once("verify_login.php");

openConnection();
if(!empty($HTTP_POST_FILES["slika"])) {
    // copy the file to some permanent location
    if (move_uploaded_file($HTTP_POST_FILES["slika"]["tmp_name"], $uploaddir . $HTTP_POST_FILES["slika"]["name"])) {
        $slika = $HTTP_POST_FILES["slika"]["name"];
	chmod($uploaddir . $slika, 0644);
    } else {
        echo ("Greska vo slikata! Slika e obavezna ovde.");
        exit;
    }
}
$sql = "insert into $tbl_lokacija (ime, slika, voved, timestamp) values ('".$ime."','".$slika."','".$voved."', now())";
$res = mysql_query ($sql)
	or die("No insert. Try again sunser!");
header("location:index.php");
?>